package com.example.startscreen;

public class Category {

	static Category[] arrCategory = {
		new Category(0,"Sve kategorije", "All Categories"),
		new Category(2,"Istorija", "History"),
		new Category(3,"Priroda", "Nature"),
		new Category(7,"Arheologija", "Archeology"),
	};
	
	static enum categoryEnum {
		ALL(0), MUNICIPALS(0), HISTORY(2), NATURE(3), ARCHEOLOGY(7);
		private int value;

		public static categoryEnum valueOf(int id) {
			
			categoryEnum[] values = categoryEnum.values(); 

			// Iterate through the list and return the proper one; else throw exception. 
			for ( categoryEnum e : values ) { 
				if ( e.ordinal() == id ) { 
					return e; 
				}
			}
//			return (CULTURE);	// error
			// if we made it here, then we did not find any corresponding 
			// enumeration to return; throw an IllegalArgumentException. 
			throw new IllegalArgumentException( "Ordinal: " + id + " is not a valid enumeration value." ); 

		}

		public static int getInt(categoryEnum e) {
			return e.getValue();
		}

		private categoryEnum(int value) {
			this.value = value;
		}

		public int getValue() {
			return value;
		}
	}
	
	int catID;
	String ime;
	String name;
	
	public Category(int catID, String ime, String name) {
		this.catID = catID;
		this.ime = ime;
		this.name = name;
	}

}
